import {Injectable} from '@angular/core';
import * as svgIcons from './svg-icons';
import {NzIconService} from 'ng-zorro-antd';

@Injectable({
  providedIn: 'root'
})
export class SvgIconRegisterService {
  private namespace = 'oplatform';

  // tslint:disable-next-line:variable-name
  constructor(private _iconService: NzIconService) {
    const iconsMap = svgIcons.iconsMap;
    Object.keys(iconsMap).forEach((prop) => {
      const svg = iconsMap[prop];
      this._iconService.addIconLiteral(`${this.namespace}:${prop}`, svg);
    });
  }
}
